home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / toolbar.el < prev    next >
Encoding:
Text File  |  1995-08-26  |  2.3 KB  |  65 lines

  1. ;; Toolbar support.
  2. ;; Copyright (C) 1995 Board of Trustees, University of Illinois
  3.  
  4. ;; This file is part of XEmacs.
  5.  
  6. ;; XEmacs is free software; you can redistribute it and/or modify it
  7. ;; under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation; either version 2, or (at your option)
  9. ;; any later version.
  10.  
  11. ;; XEmacs is distributed in the hope that it will be useful, but
  12. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14. ;; General Public License for more details.
  15.  
  16. ;; You should have received a copy of the GNU General Public License
  17. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  18. ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. (defvar toolbar-help-enabled t
  21.   "If non-nil help is echoed for toolbar buttons.")
  22.  
  23. (defvar toolbar-icon-directory nil
  24.   "Location of standard toolbar icon bitmaps.")
  25.  
  26. (defun toolbar-make-button-list (up &optional down disabled cap-up cap-down cap-disabled)
  27.   "Calls make-glyph on each arg and returns a list of the results."
  28.   (if (featurep 'x)
  29.       (let ((up-glyph (make-glyph up))
  30.         (down-glyph (and down (make-glyph down)))
  31.         (disabled-glyph (and disabled (make-glyph disabled)))
  32.         (cap-up-glyph (and cap-up (make-glyph cap-up)))
  33.         (cap-down-glyph (and cap-down (make-glyph cap-down)))
  34.         (cap-disabled-glyph (and cap-disabled (make-glyph cap-disabled))))
  35.     (if cap-disabled
  36.         (list up-glyph down-glyph disabled-glyph
  37.           cap-up-glyph cap-down-glyph cap-disabled-glyph)
  38.       (if cap-down
  39.         (list up-glyph down-glyph disabled-glyph
  40.           cap-up-glyph cap-down-glyph)
  41.         (if cap-up
  42.         (list up-glyph down-glyph disabled-glyph cap-up-glyph)
  43.           (if disabled-glyph
  44.           (list up-glyph down-glyph disabled-glyph)
  45.         (if down-glyph
  46.             (list up-glyph down-glyph)
  47.           (list up-glyph)))))))
  48.     nil))
  49.  
  50. (defun init-toolbar-location ()
  51.   (if (not toolbar-icon-directory)
  52.       (setq toolbar-icon-directory
  53.         (file-name-as-directory
  54.          (expand-file-name "toolbar" data-directory)))))
  55.  
  56. (defun init-toolbar-from-resources (locale)
  57.   (if (and (featurep 'x)
  58.        (or (eq locale 'global)
  59.            (eq 'x (device-or-frame-type locale)))
  60.        (x-init-toolbar-from-resources locale))))
  61.  
  62.  
  63. (if (featurep 'x)
  64.     (provide 'toolbar))
  65.